/*
 * JDialog.java
 *
 * Created on October 12, 2004, 8:42 AM
 * @author  Inna
 */

package edu.umd.essic.maskbuilder;

import java.io.*;
import java.lang.*;
import java.awt.*;

public class Int_Dialog extends javax.swing.JDialog {
    /** A return status code - returned if Cancel button has been pressed */
    public boolean OnCancel = false;
    public boolean paused = false;
            
    /** Creates new form JDialog */
    public Int_Dialog(java.awt.Frame parent) {
        super(parent);
        initComponents();
        //Image img = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/edu/umd/essic/maskbuilder/world.gif"));
        //this.setIconImage(img);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        jPanel1 = new javax.swing.JPanel();
        jProgressBar1 = new javax.swing.JProgressBar();
        jPanel2 = new javax.swing.JPanel();
        CancelButton = new javax.swing.JButton();

        getContentPane().setLayout(new java.awt.GridLayout(2, 1, 0, 5));

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Data processing in progress...");
        setLocationRelativeTo(this);
        setName("IntDialog");
        getAccessibleContext().setAccessibleParent(this);
        jPanel1.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 15));

        jProgressBar1.setBorder(new javax.swing.border.BevelBorder(javax.swing.border.BevelBorder.LOWERED));
        jProgressBar1.setPreferredSize(new java.awt.Dimension(400, 27));
        jPanel1.add(jProgressBar1);
        jProgressBar1.getAccessibleContext().setAccessibleName("myProgress");

        getContentPane().add(jPanel1);

        CancelButton.setFont(new java.awt.Font("MS Sans Serif", 0, 14));
        CancelButton.setText("Cancel");
        CancelButton.setPreferredSize(new java.awt.Dimension(80, 27));
        CancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                CancelButtonActionPerformed(evt);
            }
        });

        jPanel2.add(CancelButton);

        getContentPane().add(jPanel2);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-449)/2, (screenSize.height-129)/2, 449, 129);
    }//GEN-END:initComponents

    private void CancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_CancelButtonActionPerformed
        OnCancel = true;
        doClose();
    }//GEN-LAST:event_CancelButtonActionPerformed
    
    public boolean getReturnStatus() {
        if (!OnCancel)
           return true;
        else 
           return false;
    }
    
    public void doClose() {
        setVisible(false);
        dispose();
    }
    /**
     * @param args the command line arguments
     */
    /*public static void main(String args[]) {
        new Int_Dialog(new javax.swing.JFrame()).show();
    }*/
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton CancelButton;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    public javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration//GEN-END:variables
    
}
